#include <stdio.h>  //std:标准 i:input o:output h.头文件
 
int main()//主函数：程序开头，有且只有一个
{
#if 0
    /*数据类型
    char 
    short int long ;long long：大小差别
    float double:精度区别
    */

    /*整数-（short, int, long）*/
    short distance = 50000;

    /*计算内存大小  -  sizeof.  */
    int length = sizeof(distance);  //short占用2个字节


    printf("length = %d\n", sizeof(short));//  %d表示十进制打印

    /* 变量命名规范：只能以下划线，数字，字母表示，不能和关键字冲突，不能以数字开头*/
    int PersonNum=1234567846;
    printf("length = %ld\n",sizeof(int));


    long  TimeNum=123456789645615615;
    printf("length = %ld\n",sizeof(long));

#endif


/* 浮点数-小数*/
float num = 1.11651616;

printf ("num = %.5f\n",num);//打印小数用  %f  ,打印几位小数点用%。5f

printf("length = %ld\n",sizeof(float));


double dimonHeight = 2.155161516516516;
printf("num = %.6f\n",dimonHeight);
printf("length = %ld\n",sizeof(double));



/* 字符型 */
char ch = 'A';//字符用单引号表示
printf("length = %ld\n", sizeof(char));
printf("ch = %c, ch = %d\n", ch, ch);

char hc = 'P';
printf ("length = %ld\n",sizeof(hc));
printf ("hc = %c,hc = %d\n",hc  ,hc);


    printf("Hello World!\n\n\n\n");//\n表示换行

    return 0;
 }


